const BASEURL = '/dpc';
const BASE_URL = 'http://157.122.54.189:9088';

export const request = (e) => {
	return new Promise((resolve, reject) => {
		uni.showLoading({
			title: "加载中"
		})
		
		uni.request({
			...e,
			
			// #ifdef H5
				url: BASEURL + e.url,
			// #endif
			
			// #ifdef MP-WEIXIN
				url: BASE_URL + e.url,
			// #endif
			
			success: (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				reject(err)
			},
			
			
			complete: () => {
				uni.hideLoading();
			}
		})
	})
}